Skip to content

Don't use suffix _ in eta expansion #11314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2021
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 4, 2021

There was a superfluous _ added in eta expansion. That was needed in Scala 2,
but is no longer needed in Scala 3.

Fixes #11311

There was a superfluous `_` added in eta expansion. That was needed in Scala 2,
but is no longer needed in Scala 3.

Fixes scala#11311
@odersky odersky requested a review from griggt February 4, 2021 12:05
Copy link
Contributor

@griggt griggt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passes without the fix from this PR applied. I would suggest moving or copying i11311.scala to tests/pos-special and compiling with -source 3.1, as is done for i7296:

https://github.com/lampepfl/dotty/blob/33ece581e67c8eeaff8ef6583fe8762b66aa9d30/compiler/test/dotty/tools/dotc/CompilationTests.scala#L52

Also, should the doc comment be updated?

https://github.com/lampepfl/dotty/blob/46d607624e2b10663634e3cfed7dc0e1f8a50a19/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala#L187-L189

Otherwise, LGTM.

@griggt griggt assigned odersky and unassigned griggt Feb 5, 2021
@odersky odersky merged commit 49389b3 into scala:master Feb 5, 2021
@odersky odersky deleted the fix-11311 branch February 5, 2021 12:00
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eta expansion val f = mymethod (i.e., no applied argument lists) shows spurious error about trailing "_"
3 participants